<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@page import="portal.entidades.Articulo"%>
<%@page import="java.util.List"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Carrito 2014</title>
        <link href="../media/dataTables/demo_page.css" rel="stylesheet" type="text/css" />
        <link href="../media/dataTables/demo_table.css" rel="stylesheet" type="text/css" />
        <link href="../media/dataTables/demo_table_jui.css" rel="stylesheet" type="text/css" />
        <link href="../media/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" media="all" />
        <link href="../media/themes/smoothness/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" media="all" />
        <script src="../scripts/jquery-1.4.4.min.js" type="text/javascript"></script>
        <script src="../scripts/jquery.dataTables.min.js" type="text/javascript"></script>
        <script src="../scripts/configuration.jquery.dataTables.editable.js" type="text/javascript"></script>
        <script src="../scripts/jquery.jeditable.js" type="text/javascript"></script>
        <script src="../scripts/jquery.validate.js" type="text/javascript"></script>
        <script src="../scripts/jquery-ui.js" type="text/javascript"></script>

<script type="text/javascript">
	$(document).ready(function() {
		//alert("Llegue");
		 $("#tableMisCompras").dataTable({
             "bServerSide": true,
             "scrollY": "200px",
             "scrollCollapse": true,
             "aLengthMenu": [5, 10, 25, 50],
             "pageLength": "50",
             "order": [[ "0", "desc" ]],
             "sAjaxSource": "../Compras/MisComprasList",
             "bProcessing": true,
             "sPaginationType": "full_numbers",
             "bJQueryUI": true,
             "fnRowCallback": function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
				//alert(aData[1]);
				var col = aData[1];
				if(col == 'Carrito') {
					 $('td:eq(1)', nRow).html("<b style='background-color: red; color: white;'>"+ col +"</b>" );
				}
				else if(col  == 'Pendiente de Entrega') {
					 $('td:eq(1)', nRow).html("<b style='background-color: yellow;'>"+ col +"</b>" );
				}
				else if(col  == 'Entregado') {
					 $('td:eq(1)', nRow).html("<b style='background-color: green;'>"+ col +"</b>" );
				}
		         return nRow;
             },
             "aoColumns": [
                   { "sName": "Identificador" },
                   { "sName": "Estado" },
                   { "sName": "Fecha" },
                   { "sName": "Monto" }
                  ]
         });
	});
</script>

</head>
<body>
		<div align="right"><b style="vertical-align: bottom; padding-right: 0"><img alt="test" src="../images/carrito-miscompras.png"></div>
		<br>
		<table id="tableMisCompras" width="80%" class="display">
			<thead>
				<th>Identificador</th>
				<th>Estado</th>
				<th>Fecha</th>
				<th>Monto de Compra</th>
			</thead>
			<tbody>
			
			</tbody>
	</div>
</body>
</html>